package cn.kooki.app.duobao.core;


import cn.kooki.app.duobao.BuildConfig;
import cn.kooki.app.duobao.data.constant.Constants;
import retrofit.RestAdapter;


/**
 * Created by GuDong on 15/10/8.
 * Contact with 1252768410@qq.com
 */
public class MainRetrofit {

    final APIService mService;

    MainRetrofit() {

        RestAdapter.LogLevel level = null;
        if (BuildConfig.DEBUG) {
            level = RestAdapter.LogLevel.FULL;
        } else {
            level = RestAdapter.LogLevel.NONE;
        }
        RestAdapter restAdapter = new RestAdapter.Builder()
                .setEndpoint(Constants.BASE_URL + Constants.API_BASE)
                .setLogLevel(level)
                .build();
        mService = restAdapter.create(APIService.class);
    }

    public APIService getService() {
        return mService;
    }
}
